<template>
  <div class="home-firm">
    <van-nav-bar>
      <span slot="left"><van-icon name="column" /> 湖南征信认证家服公司</span>
    </van-nav-bar>
    <!-- 认证公司-内容 -->
    <van-card
      v-for="(item, index) in frimList"
      :key="item.id"
      :desc="item.brief"
      :title="item.name"
      :thumb="item.pic"
      :class="delborder(index)"
      @click="cutFrim(item.id)"
    >
      <template #tags>
        <van-tag
          plain
          type="primary"
          v-for="(arr, index) in item.tag"
          :key="index"
          >{{ arr }}</van-tag
        >
        <!-- <van-tag plain type="primary">服务好</van-tag>
        <van-tag plain type="primary">环境优美</van-tag> -->
      </template>
      <template #footer>
        <div>
          <div style="float: left">
            <van-icon name="location" size="15" />
            <span>{{ item.distance }}</span>
          </div>
          <span>{{ item.address }}...</span>
        </div>
      </template>
    </van-card>
    <p @click="$router.push('/company')">
      更多公司<van-icon name="arrow" color="#979191" size="14" />
    </p>
  </div>
</template>

<script>
export default {
  name: 'FrimList',
  props: {
    frimList: {
      type: Array,
      require: true,
    },
  },

  methods: {
    delborder(index) {
      if (this.frimList.length - 1 === index) {
        return 'delborder'
      }
    },
    cutFrim(id) {
      this.$router.push({
        path: `/frim/${id}`,
      })
    },
  },
}
</script>

<style scoped lang="less">
// 认证公司
.home-firm {
  background-color: #fff;
  height: 100%;
  padding-bottom: 10px;
  margin-bottom: 20px;
  .van-nav-bar__content {
    height: 90px;
    border-bottom: 1px solid #f0eeee;
    span {
      font-size: 20px;
      font-weight: 600;
      .van-icon {
        color: #979191;
        font-size: 40px;
        margin-right: 10px;
        vertical-align: middle;
      }
    }
  }
  .van-card {
    background-color: #fff;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0eeee;
    .van-card__header {
      .van-card__content {
        .van-card__title {
          font-size: 25px;
          font-weight: 600;
          margin-bottom: 13px;
        }
        .van-card__desc {
          color: #979191;
          font-weight: 500;
          margin-bottom: 18px;
        }
        span {
          display: inline-block;
          width: 115px;
          height: 46px;
          border: 1px solid #3f51b5;
          border-radius: 25px;
          text-align: center;
          line-height: 46px;
          color: #3f51b5;
          font-size: 14px;
          margin-right: 8px;
        }
      }
    }
    .van-card__footer {
      div {
        margin-top: 20px;
        div {
          margin-top: 0;
          .van-icon {
            color: #979191;
            margin-right: 7px;
            vertical-align: middle;
          }
          span {
            font-size: 17px;
            font-weight: 600;
            color: #000;
          }
        }
        span {
          color: #979191;
          vertical-align: middle;
        }
      }
    }
  }
  p {
    font-size: 20px;
    color: #979191;
    text-align: center;
    font-weight: 500;
  }
}
.delborder {
  border: 0 !important;
}
</style>
